import request from '@/utils/request'

// 查询OSS渠道列表
export function listChannel(query) {
  return request({
    url: '/cms/oss/channel/list',
    method: 'get',
    params: query
  })
}

// 查询OSS渠道详细
export function getChannel(id) {
  return request({
    url: '/cms/oss/channel/' + id,
    method: 'get'
  })
}

// 新增OSS渠道
export function addChannel(data) {
  return request({
    url: '/cms/oss/channel',
    method: 'post',
    data: data
  })
}

// 修改OSS渠道
export function updateChannel(data) {
  return request({
    url: '/cms/oss/channel',
    method: 'put',
    data: data
  })
}

// 删除OSS渠道
export function delChannel(id) {
  return request({
    url: '/cms/oss/channel/' + id,
    method: 'delete'
  })
}

// 锁定渠道
export function lockChannel(id) {
  return request({
    url: '/cms/oss/channel/lock/' + id,
    method: 'post',
  })
}
